﻿using System;
using System.Collections.Generic;
using System.Linq;
using SurveySez.Model;
using SurveySez.NavigationModel;

namespace SurveySez.ViewModel.GamePlay
{
    public class GameViewModel
	{
		private Game _game;
		private GameNavigation _navigation;

		public GameViewModel(Game game, GameNavigation navigation)
		{
			_game = game;
			_navigation = navigation;
		}

		public string Question
		{
			get { return _navigation.CurrentRound.Survey.Question; }
		}

		public IEnumerable<AnswerViewModel> Answers
		{
			get
			{
				return _navigation.CurrentRound.Survey.Responses
					.OrderBy(a => a.Order)
					.Select(a => AnswerViewModel.Wrap(a, _navigation));
			}
		}

		public string IncorrectGuesses
		{
			get { return "XXX".Substring(3-_navigation.CurrentRound.IncorrectGuesses); }
		}
	}
}
